package ch.creasystem.tennis.playermgmt.facade;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;

import ch.creasystem.tennis.playermgmt.entities.Player;

/**
 * Service facade providing CRUD functions for the user management
 * @author David Gerber
 *
 */

@Local
public interface PlayerMgmtService {
	/**
	 * Create a new player
	 * @param name
	 * @param lastname
	 * @param birthdate
	 * @return the newly created player
	 */
    public Player createPlayer(String name, String lastname, Date birthdate);
    
    /**
     * Find a player with the specified playerId
     * @param playerId
     * @return the player or null if not found
     */
    public Player getPlayerById(Long playerId);
    
    /**
     * Find all players
     * @return the list of all players
     */
    public List<Player> getAllPlayers();
    
    /**
     * update the specified player
     * @param player
     * @return the updated player
     */
	public Player updatePlayer(Player player) ;
	
	/**
	 * delete the specified player
	 * @param playerId
	 */
	public void deletePlayer(Long playerId);
}
